package net.huashitong.gis.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import com.sirdc.modules.utils.StringUtils;
import net.huashitong.gis.dao.RegisterDao;
import net.huashitong.gis.entity.InterviewRegister;
import net.huashitong.gis.filter.InterviewRegisterFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegisterService extends StringPKService<InterviewRegister> {
    @Autowired
    private RegisterDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<InterviewRegister, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(InterviewRegister obj) {
        obj.setSysId(tableService.updateMaxSysId("t_gis_interviewRegister", null));
    }
    public List<InterviewRegister> queryRegister(InterviewRegisterFilter filter) {
        return dao.queryRegister(filter);
    }

    /**
     * 根据企业名称模糊查询走访登录详情
     * @param enterpriseName
     * @return
     */
    public List<InterviewRegister> queryByEnterpriseNameVague(String enterpriseName){
        return dao.queryByEnterpriseNameVague(enterpriseName);
    }


}